package com.grocery.controller;

import com.grocery.service.impl.RegisterService;
import com.grocery.bean.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class RegisterController {
    @Autowired
    RegisterService registerService;
    @RequestMapping("page/register")
    @ResponseBody
    public int doAdd(User user) {
        if(user!=null){
            return registerService.doRegister(user);
        }else {
            return -1;
        }
    }
}
